<template>
  <div class="app-container">
    <!-- 页面内容区域的占位符 -->
    <div class="content-area">
      <!-- 顶部栏 -->
      <div class="top-bar">
        <div class="top-item">
          <img src="@/assets/1.png" class="top-icon" />
          <span class="top-num">0</span>
        </div>
        <div class="top-item">
          <img src="@/assets/2.jpg" class="top-icon" />
          <span class="top-label">排名</span>
        </div>
        <div class="top-item">
          <img src="@/assets/3.png" class="top-icon" />
          <span class="top-label">任务</span>
        </div>
      </div>

      <!-- 专升本词汇卡片 -->
      <div class="word-card">
        <img src="@/assets/shuben.png" class="word-card-img" />
        <div class="word-card-info">
          <div class="word-card-title">
            专升本词汇 <span class="word-card-edit">修改 &gt;</span>
          </div>
          <div class="word-card-progress-bar">
            <div class="word-card-progress-inner"></div>
          </div>
          <div class="word-card-progress">
            <span>0 / 4056</span>
            <span class="word-card-days">剩余 406 天</span>
          </div>
        </div>
      </div>

      <!-- 今日计划 -->
      <div class="plan-section">
        <div class="plan-title">
          今日计划
          <span class="plan-link">新品上线！学习还能养小狗</span>
        </div>
        <div class="plan-content">
          <div class="plan-item">
            <div class="plan-label">已新学</div>
            <div class="plan-value"><span class="plan-num">0</span> / 10</div>
          </div>
          <div class="plan-item">
            <div class="plan-label">已复习</div>
            <div class="plan-value"><span class="plan-num">0</span> / 0</div>
          </div>
        </div>
        <div class="plan-btns">
          <button class="plan-btn study-btn" :class="{ selected: studyMode === 'study' }" @click="goToXueXi">学习</button>
          <button class="plan-btn review-btn" :class="{ selected: studyMode === 'review' }"
            @click="goToFuXi">复习</button>
        </div>
      </div>

      <!-- 四个功能按钮 -->
      <div class="func-row">
        <div class="func-item">
          <img src="@/assets/a.png" class="func-img" />
          <div class="func-text">薄荷阅读</div>
        </div>
        <div class="func-item">
          <img src="@/assets/b.png" class="func-img" />
          <div class="func-text">单词训练</div>
        </div>
        <div class="func-item">
          <img src="@/assets/c.png" class="func-img" />
          <div class="func-text">单词本</div>
        </div>
        <div class="func-item">
          <img src="@/assets/d.png" class="func-img" />
          <div class="func-text">单词自检</div>
        </div>
      </div>

      <!-- 三个横向卡片 -->
      <div class="card-box yellow">
        <img src="@/assets/11.png" class="card-img" />
        <div class="card-info">
          <div class="card-title">专升本一对一专属上岸规划</div>
          <div class="card-desc">规划专属定制，升本秒变大神。</div>
        </div>
      </div>
      <div class="card-box blue">
        <img src="@/assets/22.jpg" class="card-img" />
        <div class="card-info">
          <div class="card-title">专升本英语核心词汇通关营</div>
          <div class="card-desc">零基础适用，核心词汇一网打尽</div>
        </div>
      </div>
      <div class="card-box gray">
        <img src="@/assets/33.png" class="card-img" />
        <div class="card-info">
          <div class="card-title">强烈建议大学生er考个雅思！</div>
          <div class="card-desc">150h雅思7+，就业/保研/留学全搞定</div>
        </div>
      </div>
    </div>

    <!-- 底部导航栏 -->
    <tabbar isshow="0"></tabbar>
  </div>
  <div>User Profile</div>
</template>

<script setup>
import { ref } from 'vue';
import { useRouter } from 'vue-router';
import tabbar from '@/components/tabbar.vue'
import {
  AlignJustify,
  Play,
  Globe,
  Grid,
  User
} from 'lucide-vue-next';

const router = useRouter();

// 当前激活的标签页
const activeTab = ref('me'); // 默认激活"我"标签页

// 是否显示红点提示
const hasBadge = ref(true);

// 学习/复习切换
const studyMode = ref('study');
function selectMode(mode) {
  studyMode.value = mode;
}

function goToXueXi() {
  router.push({ name: 'XueXi' }); // 跳转到 XueXi.vue 页面
}

function goToFuXi() {
  router.push({ name: 'FuXi ' }); // 跳转到 FuXi.vue 页面，注意name有空格
}
</script>


<style scoped>
/* 应用容器 - 设置正确的页面大小 */
.app-container {
  max-width: 100%;
  width: 100%;
  height: 100vh;
  background-color: #f5f5f5;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  position: relative;
  overflow: hidden;
  background: #222;
}

/* 内容区域 */
.content-area {
  width: 100%;
  flex: unset;
  overflow-y: unset;
  -webkit-overflow-scrolling: unset;
  height: auto;
}

/* 底部导航栏 */
.bottom-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: white;
  height: 60px;
  border-top: 1px solid #eee;
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  position: relative;
  cursor: pointer;
}

.nav-icon {
  width: 24px;
  height: 24px;
  color: #888;
}

.nav-text {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

.active .nav-icon,
.active .nav-text {
  color: #333;
}

.nav-badge {
  position: absolute;
  top: 8px;
  right: calc(50% - 16px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ff4a4a;
}

/* 顶部栏 */
.top-bar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  background: #222;
  padding: 45px 0 0 0;
  gap: 30px;
}

.top-item {
  display: flex;
  align-items: center;
  background: #444;
  border-radius: 16px;
  padding: 0 18px;
  height: 36px;
  margin-left: 30px;
}

.top-icon {
  width: 24px;
  height: 24px;
  margin-right: 4px;
}

.top-num {
  font-size: 20px;
  font-weight: bold;
  color: #bfc2c7;
}

.top-label {
  font-size: 16px;
  color: #bfc2c7;
}

/* 专升本词汇卡片 */
.word-card {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  margin: 50px 30px 0 30px;
  padding: 30px;
  box-shadow: 0 2px 8px #f0f1f2;
}

.word-card-img {
  width: 56px;
  height: 72px;
  margin-right: 12px;
}

.word-card-info {
  flex: 1;
}

.word-card-title {
  font-size: 18px;
  font-weight: bold;
  color: #222;
  display: flex;
  align-items: center;
}

.word-card-edit {
  font-size: 14px;
  color: #888;
  margin-left: 8px;
}

.word-card-progress-bar {
  width: 100%;
  height: 6px;
  background: #f2f2f2;
  border-radius: 3px;
  margin: 8px 0 4px 0;
  overflow: hidden;
}

.word-card-progress-inner {
  width: 0%;
  height: 100%;
  background: #4a90e2;
}

.word-card-progress {
  font-size: 14px;
  color: #888;
  display: flex;
  justify-content: space-between;
}

.word-card-days {
  color: #bbb;
}

/* 今日计划 */
.plan-section {
  background: #fff;
  border-radius: 12px;
  margin: 50px 30px 0 30px;
  padding: 30px;
}

.plan-title {
  font-size: 16px;
  font-weight: bold;
  color: #222;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.plan-link {
  font-size: 14px;
  color: #2979ff;
}

.plan-content {
  display: flex;
  justify-content: space-between;
  margin: 18px 0 0 0;
}

.plan-item {
  flex: 1;
  text-align: center;
}

.plan-label {
  color: #888;
  font-size: 14px;
}

.plan-value {
  font-size: 16px;
  color: #222;
  margin-top: 4px;
}

.plan-num {
  font-size: 32px;
  font-weight: bold;
  color: #222;
}

.plan-btns {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  gap: 12px;
}

.plan-btn {
  flex: 1;
  height: 44px;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  color: #fff;
  background: #2979ff;
  cursor: pointer;
}

.review-btn {
  background: #f2f4f8;
  color: #2979ff;
}

/* 按钮选中高亮 */
.plan-btn.selected {
  background: #2979ff;
  color: #fff;
  box-shadow: 0 2px 8px #e3eaff;
}

.plan-btn:not(.selected) {
  background: #f2f4f8;
  color: #2979ff;
}

/* 四个功能按钮 */
.func-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 50px 30px 0 30px;
  background: #fff;
  border-radius: 12px;
  padding: 20px 0;
}

.func-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.func-img {
  width: 32px;
  height: 32px;
}

.func-text {
  font-size: 14px;
  color: #222;
  margin-top: 4px;
}

/* 三个横向卡片 */
.card-box {
  display: flex;
  align-items: center;
  border-radius: 12px;
  margin: 50px 30px 0 30px;
  padding: 45px 30px;
  background: #f5f5f5;
}

.card-box.yellow {
  background: linear-gradient(90deg, #fffbe6 0%, #ffe58f 100%);
}

.card-box.blue {
  background: linear-gradient(90deg, #e6f7ff 0%, #bae7ff 100%);
}

.card-box.gray {
  background: #f5f5f5;
}

.card-img {
  width: 56px;
  height: 56px;
  margin-right: 12px;
  border-radius: 8px;
  object-fit: cover;
}

.card-info {
  flex: 1;
}

.card-title {
  font-size: 16px;
  font-weight: bold;
  color: #222;
}

.card-desc {
  font-size: 14px;
  color: #888;
  margin-top: 4px;
}

/* 移除 content-area 的滚动条，恢复外层滚动条 */
html,
body {
  height: auto;
  overflow: auto;
}
</style>